package com.yc.edu.validator;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author YC
 * @version 1.0
 */
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = {IsEmailValidator.class})
public @interface IsEmail {
    String message() default "邮箱格式错误";

    boolean required() default true;

    Class<?>[] groups() default {}; // 默认参数

    Class<? extends Payload>[] payload() default {}; // 默认参数
}
